/* 스케줄 작업 결과*/
function initGridNomalAccount() {
	$("#gridList").jqGrid({
		url:'getJqgridAccount1List.jsp',
		mtype: 'post',
		//postData: {  },
		datatype: "json",
		colNames:['구분','시스템','계정','최종로그인시간'],
		colModel:[
				{name:'type',index:'type', width:150,align:"center",key:true},
				{name:'system',index:'system',width:170,align:"center"},
				{name:'account',index:'account', width:100,align:"center"},
				{name:'last_login_time',index:'last_login_time', width:100,align:"center"}
			],
		rowList: [0,5,10,15,20],
		//rowNum:100,
		height:200,
		width:100,
		autowidth : true,
		sortname: "time",
		sortorder: 'DESC',
		viewrecords: true,
		multiselect: false,//앞에 체크박스처리
		multikey: "",//multikey: "ctrlKey/shiftKey",
		pager: false,
      
		onSelectRow: function(id){  //row가 선택되었을 경우
		},
		loadComplete : function(data){
        },
		loadError : function(xhr,st,err) {
			//jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
		},
		emptyrecords: "데이터가 존재하지 않습니다.",
		caption:'테이블',
		jsonReader: {
			repeatitems:false
		}
	});
	$("#gridList").jqGrid('navGrid','#pager_id',{edit:false,add:false,del:false,search:true});
}

/* 계정 신청 내역*/
function initGridValidAccount() {
	$("#gridList2").jqGrid({
		url:'getJqgridAccount2List.jsp',
		mtype: 'post',
		//postData: {  },
		datatype: "json",
		colNames:['구분','시스템','계정','최종로그인시간'],
		colModel:[
				{name:'type',index:'type', width:50,align:"center",key:true},
				{name:'system',index:'system', width:50,align:"center"},
				{name:'account',index:'account', width:50,align:"center"},
				{name:"last_login_time",index:'last_login_time', width:100,align:"center"}
			],
		rowList: [0,5,10,15,20],
		//rowNum:5,
		height:200,
		width:100,
		autowidth : true,
		sortname: "worker",
		sortorder: 'DESC',
		viewrecords: true,
		multiselect: false,//앞에 체크박스처리
		multikey: "",//multikey: "ctrlKey/shiftKey",
		pager: '#pager_id',
      
		onSelectRow: function(id){  //row가 선택되었을 경우
		},
		loadComplete : function(data){
        },
		loadError : function(xhr,st,err) {
			//jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
		},
		emptyrecords: "데이터가 존재하지 않습니다.",
		caption:'테이블',
		jsonReader: {
			repeatitems:false
		}
	});
	$("#gridList2").jqGrid('navGrid','#pager_id',{edit:false,add:false,del:false,search:true});
}


/* 로그온 세션*/
function initGridExpireAccount() {
	$("#gridList3").jqGrid({
		url:'getJqgridAccount3List.jsp',
		mtype: 'post',
		//postData: {  },
		datatype: "json",
		colNames:['사용자','시스템명','계정','만료일'],
		colModel:[
				{name:'user',index:'user', width:50,align:"center",key:true},
				{name:'system_name',index:'system_name', width:50,align:"center"},
				{name:'account',index:'account', width:50,align:"center"},
				{name:'expire_date',index:'expire_date', width:50,align:"center"}
			],
		rowList: [0,5,10,15,20],
		//rowNum:5,
		height:200,
		width:100,
		autowidth : true,
		sortname: "worker",
		sortorder: 'DESC',
		viewrecords: true,
		multiselect: true,//앞에 체크박스처리
		multikey: "",//multikey: "ctrlKey/shiftKey",
		pager: '#pager_id',
      
		onSelectRow: function(id){  //row가 선택되었을 경우
		},
		loadComplete : function(data){
			        },
		loadError : function(xhr,st,err) {
			//jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
		},
		emptyrecords: "데이터가 존재하지 않습니다.",
		caption:'테이블',
		jsonReader: {
			repeatitems:false
		}
	});
	$("#gridList3").jqGrid('navGrid','#pager_id',{edit:false,add:false,del:false,search:true});
}


/* 비밀번호 변경 추적 */
function initGridUnusualAccount() {
	$("#gridList4").jqGrid({
		url:'getJqgridAccount4List.jsp',
		mtype: 'post',
		//postData: {  },
		datatype: "json",
		colNames:['구분','시스템','계정','최종로그인시간'],
		colModel:[
				{name:'type',index:'type', width:50,align:"center",key:true},
				{name:'system',index:'system', width:50,align:"center"},
				{name:'account',index:'account', width:50,align:"center"},
				{name:'last_login_time',index:'last_login_time', width:50,align:"center"}
			],
		rowList: [0,5,10,15,20],
		//rowNum:5,
		height:200,
		width:100,
		autowidth : true,
		sortname: "worker",
		sortorder: 'DESC',
		viewrecords: true,
		multiselect: false,//앞에 체크박스처리
		multikey: "",//multikey: "ctrlKey/shiftKey",
		pager: '#pager_id',
      
		onSelectRow: function(id){  //row가 선택되었을 경우
		},
		loadComplete : function(data){
        },
		loadError : function(xhr,st,err) {
			//jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
		},
		emptyrecords: "데이터가 존재하지 않습니다.",
		caption:'테이블',
		jsonReader: {
			repeatitems:false
		}
	});
	$("#gridList4").jqGrid('navGrid','#pager_id',{edit:false,add:false,del:false,search:true});
}



/* 작업 로그*/
function initGridLockAccount() {
	$("#gridList5").jqGrid({
		url:'getJqgridAccount5List.jsp',
		mtype: 'post',
		//postData: {  },
		datatype: "json",
		colNames:['구분','시스템','계정','최종로그인시간'],
		colModel:[
				{name:'type',index:'type', width:50,align:"center",key:true},
				{name:'system',index:'system', width:50,align:"center"},
				{name:'account',index:'account', width:50,align:"center"},
				{name:"last_login_time",index:'last_login_time', width:100,align:"center"}
			],
		rowList: [0,5,10,15,20],
		//rowNum:5,
		height:200,
		width:100,
		autowidth : true,
		sortname: "worker",
		sortorder: 'DESC',
		viewrecords: true,
		multiselect: false,//앞에 체크박스처리
		multikey: "",//multikey: "ctrlKey/shiftKey",
		pager: '#pager_id',
      
		onSelectRow: function(id){  //row가 선택되었을 경우
		},
		loadComplete : function(data){
        },
		loadError : function(xhr,st,err) {
			//jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
		},
		emptyrecords: "데이터가 존재하지 않습니다.",
		caption:'테이블',
		jsonReader: {
			repeatitems:false
		}
	});
	$("#gridList5").jqGrid('navGrid','#pager_id',{edit:false,add:false,del:false,search:true});
}

var lastsel3;
$(document).ready(function(){
	initGridNomalAccount();//정상 계정
	initGridValidAccount();//유효 계정
	initGridExpireAccount();//만료 계정
	initGridUnusualAccount();//비정상 계정
	initGridLockAccount();//잠긴 계정
	
	$(".btn_go").on("click",function() {
		var clickId = $(this).attr("id").replace("_more","");
		$("ul.depth_1 > li > a > img").each(function( index ) {
			var menuId = $(this).attr("id");
			if( clickId == menuId ) {
				$(this).click();
			}
		});
	});

});
